UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ux4HZtQ81rEY/A9254Gl3kdc8Vug00IrvgOUTz+BOJg=' 
WHERE 
  key_id = '099c7fb93c3e4e5624fcc9fc0ce3f834f99f0816a2959b53bf23204a77386356' 
  AND (
    token = 'ux4HZtQ81rEY/A9254Gl3kdc8Vug00IrvgOUTz+BOJg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019