UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VryfPsnY5W5fDOjDJGQM4liF948RZckPGoPMd8LyFBs=' 
WHERE 
  key_id = '93e532eed0bbe9716d38e746943e35ca6421b95eb578f87d550f68381e8daefb' 
  AND (
    token = 'VryfPsnY5W5fDOjDJGQM4liF948RZckPGoPMd8LyFBs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049