UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cONf/SOomuXS8NbiA75DWrYXSeLjnNBfOy4ZrQW9sKU=' 
WHERE 
  key_id = '05c96b65588e83b8eb3f215302198dd761d04cd4c1842ca14a2e6d229a87ceae' 
  AND (
    token = 'cONf/SOomuXS8NbiA75DWrYXSeLjnNBfOy4ZrQW9sKU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017