UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '44nJOA6bv8Ag1IRLGikjPq9DXMqg8UNbAaivBXdruq0=' 
WHERE 
  key_id = 'e9f6fdf4f89275f70d6dbe528c615eddc121a94c872a15dc85abed85edfa98d1' 
  AND (
    token = '44nJOA6bv8Ag1IRLGikjPq9DXMqg8UNbAaivBXdruq0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029