UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VCLKIf8gCpnQi7PvXtE6pAX2fAwgN6xfwDE1FSuBA40=' 
WHERE 
  key_id = '97c06e55d4015183dd41493f8b5f5fc5da7cb77b162dec98284adf2b70e9cedf' 
  AND (
    token = 'VCLKIf8gCpnQi7PvXtE6pAX2fAwgN6xfwDE1FSuBA40=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030