UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UJPtvCemFCf+YaSYKTfbCEqyZCTOJWx0yGa+p/6nBO8=' 
WHERE 
  key_id = '98a89a9347b1cc2b22f9495163cd8dd8df5024cef35ca0a0303ff7de04e11357' 
  AND (
    token = 'UJPtvCemFCf+YaSYKTfbCEqyZCTOJWx0yGa+p/6nBO8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028