UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LDwMORXjbbFKWW9BzlhZqOloVcUQt9g1iKHaC52PAVg=' 
WHERE 
  key_id = 'fba8e0bbc0958060978572fc472c75b7c3f9aff708501eaeb4699aa8a6a04959' 
  AND (
    token = 'LDwMORXjbbFKWW9BzlhZqOloVcUQt9g1iKHaC52PAVg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032