UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4tUsl6ZPp9ImLtkTD1KPU/pnfrPsJUDKELgmks+7Lg0=' 
WHERE 
  key_id = '92cacf825317c9f478a752569243c34c133ec49492155096334235c5d962fb8f' 
  AND (
    token = '4tUsl6ZPp9ImLtkTD1KPU/pnfrPsJUDKELgmks+7Lg0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030