UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dSpKYF0vl6DCBTnrq+wqSE+Go03bILuGo6v4m0vAH5k=' 
WHERE 
  key_id = '2a9a92fbce7a79668b5b071c95ea16775e390a439d4bc025838ca2905eac6dfd' 
  AND (
    token = 'dSpKYF0vl6DCBTnrq+wqSE+Go03bILuGo6v4m0vAH5k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044