UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zi9jSagGFEyW/DyoFTtQ4mbaGK2LPwpyqnq5fAtoaBU=' 
WHERE 
  key_id = '5bbd774055a39c3f1b240f195abce64ce67de2be8c1e0188447262ae14ef5967' 
  AND (
    token = 'zi9jSagGFEyW/DyoFTtQ4mbaGK2LPwpyqnq5fAtoaBU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032