UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8GII48L5Q9+VTW537YJlm3H+sqs6vhLEyH/wKK9JH6E=' 
WHERE 
  key_id = '7adf49bb183a147ae640880c8e816ba9ab41a7f457f340f46da9cf7b7a5ee7f9' 
  AND (
    token = '8GII48L5Q9+VTW537YJlm3H+sqs6vhLEyH/wKK9JH6E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038