UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yVkJcB44pmknGtGOtMaokULBsd3ueGgldKqJ5iY2wnM=' 
WHERE 
  key_id = '4e05b7ed5766eac90be677ef7e1bd5c1e3be86f49cd1e4cdb77948a42a88c95e' 
  AND (
    token = 'yVkJcB44pmknGtGOtMaokULBsd3ueGgldKqJ5iY2wnM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033