UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kLU24R5m63hP4+7WSGk9gEx//Ngk9WLVKz7YPH1J3tk=' 
WHERE 
  key_id = '9039129c3ae2e4f72409d7ae076922b97e4a39a8deb9aa7533803b3d6c698cce' 
  AND (
    token = 'kLU24R5m63hP4+7WSGk9gEx//Ngk9WLVKz7YPH1J3tk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041