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

Query time 0.00029