UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DzpeUMpA2+BYdvoUHSphCXQVqu35Y05yZ3VM2ftsNUA=' 
WHERE 
  key_id = '2934272b192544bec59c812e0d24c437c4dbcea6ab1212355d6c655e0470cb0a' 
  AND (
    token = 'DzpeUMpA2+BYdvoUHSphCXQVqu35Y05yZ3VM2ftsNUA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021