UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BQKqkoOu7pYIqGflBjeUfmc64Uo8XrU4B/qQ9mSnmjU=' 
WHERE 
  key_id = 'a352b328037e1882ae378a4e60a4ff1b779935a9881b9c2f2516cc4a28e7468d' 
  AND (
    token = 'BQKqkoOu7pYIqGflBjeUfmc64Uo8XrU4B/qQ9mSnmjU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020