UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MvYfsv0O9db6R8nk2AUs8DDLinCRTiFkkWzzo4XVvhU=' 
WHERE 
  key_id = '84c47494c1101c7d8cd98b49843cf7772bcd3d246a17c9ce5344e122a72831f8' 
  AND (
    token = 'MvYfsv0O9db6R8nk2AUs8DDLinCRTiFkkWzzo4XVvhU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041