UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UY3atnLGPyQw4169q2yUw/Nrl1l6zfnvpRmcTQlUbDE=' 
WHERE 
  key_id = 'f02d82525ec5535da33ac4b6ba1a3f2f0a9f30141953fec6f698c2e574177074' 
  AND (
    token = 'UY3atnLGPyQw4169q2yUw/Nrl1l6zfnvpRmcTQlUbDE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032