UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gKDlNpmQWI0oxB1U5w9mFzIU75sB80niAMxvvWxRoIo=' 
WHERE 
  key_id = 'ed7bdc07dd7287a6a6c0047b3a034d57aac3908df9ff0b2a897b06731c198109' 
  AND (
    token = 'gKDlNpmQWI0oxB1U5w9mFzIU75sB80niAMxvvWxRoIo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036