UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xtWovZaTy/sA2nChKqqVyTkqwjJl4/8CMSXifvzc84s=' 
WHERE 
  key_id = 'c6818858ba32654e9d3c2bedba4ca8c3ad3d13a320f6b06ca6a84a379a115028' 
  AND (
    token = 'xtWovZaTy/sA2nChKqqVyTkqwjJl4/8CMSXifvzc84s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016