UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm5dlx4CTlg+MRi8DFuKdcCCD4hKUuQW46s8/eSQW51M=' 
WHERE 
  key_id = '962b933ca051c5853c90775af42577275e4cb2e830c7b07993201899781bb60e' 
  AND (
    token = 'm5dlx4CTlg+MRi8DFuKdcCCD4hKUuQW46s8/eSQW51M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014