UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Diy/W896jbBGxRSaSckfb/tugwO4CvzU4SI5gpALUAQ=' 
WHERE 
  key_id = '4a54ee2bd8743aea0e71d2f4c1b981269d903c4558ae59fd70806b2ba10aa2a6' 
  AND (
    token = 'Diy/W896jbBGxRSaSckfb/tugwO4CvzU4SI5gpALUAQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028