UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kkjEzse6VzaND2K2NnE+GCzsHL7WkRbnSGjz7gxsTww=' 
WHERE 
  key_id = '2f15589fcbb41a75be7d6849a42a2e8c7c4292a9dab945c020e958e280e8e996' 
  AND (
    token = 'kkjEzse6VzaND2K2NnE+GCzsHL7WkRbnSGjz7gxsTww=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025