UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YW/pCOxi8y9KWs3A//dCBw3XXJYCiho0TUrlpoq6KU4=' 
WHERE 
  key_id = '0696f807470e6a119f2af8e4e878d742bcde374a766f2cd1bc4a7f678f565e9c' 
  AND (
    token = 'YW/pCOxi8y9KWs3A//dCBw3XXJYCiho0TUrlpoq6KU4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058