UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yW8Sxp3JQnAWRGBsH0gwR/D6GHI/+5td00v2B/VYgfc=' 
WHERE 
  key_id = '97793c3c244b26cab5c9b63affdf9933c3416c67150acedd1bc4d228d16a1b2b' 
  AND (
    token = 'yW8Sxp3JQnAWRGBsH0gwR/D6GHI/+5td00v2B/VYgfc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047