UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6VmNUSuV6VyCkgSxhIEfiygonrwqrqRr+Z/BgZCRgEA=' 
WHERE 
  key_id = '1ab23373e0c1ff7b15345f347018c83055442e46231105e443389e10e17d0c7e' 
  AND (
    token = '6VmNUSuV6VyCkgSxhIEfiygonrwqrqRr+Z/BgZCRgEA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040