UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FSJIn4YCUB5RNznSlCF4rec6U1dUU8iqhKycN9yBqBo=' 
WHERE 
  key_id = '008509d1eb66abc1048479f74547c9c933cc34f67482b3a8a82102c199fc8b46' 
  AND (
    token = 'FSJIn4YCUB5RNznSlCF4rec6U1dUU8iqhKycN9yBqBo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043