UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zssUitxpx07jDEq3A1Zqdlj5Cik19MypVbuAhaM1viE=' 
WHERE 
  key_id = '4982e3b0ab3fcef8daad5f5e2b9023c1cb9c587113ec5f1188493c6e5c9d5b78' 
  AND (
    token = 'zssUitxpx07jDEq3A1Zqdlj5Cik19MypVbuAhaM1viE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050