UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'T9MPnue81e3sN5I92h2wkL4vvut4Xi4qJRhSxWYfYyo=' 
WHERE 
  key_id = '63124808f7d47efc3b009567fb843d646b9e46dabc0827c68be637a73b689ce1' 
  AND (
    token = 'T9MPnue81e3sN5I92h2wkL4vvut4Xi4qJRhSxWYfYyo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046