UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2XWY6VmsCXyRKNVNBq3pADsnEABzp57C+kmro8Js6jA=' 
WHERE 
  key_id = 'd8bdda0dad59356ea6897ecfa45450433551759d79429cbebec212cd33431924' 
  AND (
    token = '2XWY6VmsCXyRKNVNBq3pADsnEABzp57C+kmro8Js6jA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036