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

Query time 0.00033