UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zh/5lFZjRx6ccfuCK6jM2Ztf7mrd70Pp3SIjxGpaY2g=' 
WHERE 
  key_id = 'ad9b37f8933cdb32a9659298254211300eeeea4a9abe35099672ba5ada1e4b04' 
  AND (
    token = 'zh/5lFZjRx6ccfuCK6jM2Ztf7mrd70Pp3SIjxGpaY2g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047