UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FwgpbGKt7rN0rYFYZCM9MbrFhmAjC/GQ21XVTiGwFrY=' 
WHERE 
  key_id = '978ad8a24d4efc486f891c47c3b5d77bf312e0ef2e2e6c4649f8653c48b99578' 
  AND (
    token = 'FwgpbGKt7rN0rYFYZCM9MbrFhmAjC/GQ21XVTiGwFrY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019