UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H8Vmdn1/rvKimQNFZ8mDGp4MIQSRr0ZZlYSBuqRP8SA=' 
WHERE 
  key_id = '9ef87fc109276c08e24714bbdd1d69f0da38ece05f096ce25295261ec518c5d0' 
  AND (
    token = 'H8Vmdn1/rvKimQNFZ8mDGp4MIQSRr0ZZlYSBuqRP8SA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035