UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QxYjWCdTtXUxYS7w6qAcZmSMezc2GtRAd0VbSTFZBq4=' 
WHERE 
  key_id = '5846a8c184693084c49251acef353a0eb7ba25164726ec59965d2796e3a19e70' 
  AND (
    token = 'QxYjWCdTtXUxYS7w6qAcZmSMezc2GtRAd0VbSTFZBq4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061