UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't9w+8qECGnTK4Kq1kIc8kUpATknAXuw5xr6el479lF8=' 
WHERE 
  key_id = 'eeba2de19089c61ed5b482c9b41c685aee6ac486c364d0b009c76dbb5d868414' 
  AND (
    token = 't9w+8qECGnTK4Kq1kIc8kUpATknAXuw5xr6el479lF8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041